from multiprocessing import Process
from time import sleep


def task1(s, name):
    while True:
        sleep(s)
        print('这是任务', name, '.....')


def task2(s, name):
    while True:
        sleep(s)
        print('这是任务', name, '.....')


if __name__ == '__main__':
    p1 = Process(target=task1, name='task1', args=(1, '11'))
    p2 = Process(target=task2, name='task2', args=(2, '22'))
    p2.daemon = True

    p1.start()
    p2.start()
    print('主线程结束....')
